<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<fmt:setBundle basename="Messages" />
<title><fmt:message key="Display.ViewBookingSatus"/></title>
<link rel="stylesheet" href="jquery.treeview.css" />
<link rel="stylesheet" href="screen.css" />

<script src="lib/jquery.js" type="text/javascript"></script>
<script src="lib/jquery.cookie.js" type="text/javascript"></script>
<script src="jquery.treeview.js" type="text/javascript"></script>

<script type="text/javascript" src="demo.js"></script>
<script>
	<script src="http://code.jquery.com/jquery-latest.js">
</script>
<script type="text/javascript"
	src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script>

</head>
<body>
<img src="img/logo_ISS.jpg" class="logo" />
	<div class="header">
		<div style="float: left; margin: 11px auto 0 auto">
			<h1>
				<fmt:message key="Display.InstituteofSystemScience" />
			</h1>
		</div>
		<div style="float: right; margin: 11px auto 0 auto">
			<h1>
				<fmt:message key="Display.FacilitiesBookingSystem" />
			</h1>
		</div>
	</div>
	<div class="site_content">
		<div class="sidebar_container">
			<div class="sidebar">

			<c:choose>
					<c:when test="${sessionScope.Role=='Manager'}">
							<%@include file="managerSideMenu.jsp" %>
					</c:when>
					<c:when test="${sessionScope.Role=='Staff'}">
						
						<%@include file="staffSideMenu.jsp" %>
					</c:when>
				</c:choose>
			</div>
		</div>

		<div class="content">

<table cellspacing="2" cellpadding="10" style=" margin: 10px 0 0px 0;background:#FFF;width:450px;height:200px;border:2px;border-style:solid;border-color:#696A6A">
<tr>
	<th><fmt:message key="Display.FacilityName"/></th>
	<th><fmt:message key="Display.FromDate"/></th>
	<th><fmt:message key="Display.ToDate"/></th>
	<th><fmt:message key="Display.Status"/></th>
	
</tr>

	<c:forEach var="booking" items="${book}">
	<tr>
	<td>${booking.getFacilityName()}</td>
	<td>${booking.getFromDate()} </td>
	<td>${booking.getToDate()}</td>
	<td>${booking.getStatus()}</td>
	<td>
	<c:url var="detdurl" scope="page" value="/ViewDetailsServlet">
                            <c:param name="bookingID" value="${booking.getBookingID()}"/>
                            <c:param name="status" value="details"/>
                            </c:url>
    <a href="${detdurl}"><fmt:message key="Display.Details"/></a>
    </td>
   <c:set var="Approves" value="Approved"/>
   
    <c:if test="${booking.getStatus()==Approves}">
     <td>
        
       <c:url var="url" scope="page" value="/ManageStatusServlet">
                            <c:param name="status" value="Cancel"/>
                            <c:param name="bookingID" value="${booking.getBookingID()} " />
                            </c:url>
    <a href="${url}"><fmt:message key="Display.Cancel"/></a>
    
    </td>
    </c:if>
    <c:set var="Approve" value="Pending"/>
    <c:if test="${booking.getStatus()==Approve}">
    <td>
    	<c:url var="pgurl" scope="page" value="/ViewDetailsServlet">
                            <c:param name="status" value="Update"/>
                            <c:param name="bookingID" value="${booking.getBookingID()} " />
                            </c:url>
    <a href="${pgurl}"><fmt:message key="Display.EditBooking"/></a>
    	<c:url var="delurl" scope="page" value="/ManageStatusServlet">
                            <c:param name="status" value="Delete"/>
                            <c:param name="bookingID" value="${booking.getBookingID()} " />
                            </c:url>
    <a href="${delurl}"><fmt:message key="Display.DeleteBooking"/></a>
    </td>
    </c:if>
    
    
	
	</tr>	
	</c:forEach>

</table>
</div>

	</div>

	<div class="footer" style="align: center">Copyright@ Team3
		Erudites</div>
</body>
</html>